FROM clonelin/centos8-node22-prisma:latest

ENV PATH="/root/.nvm/versions/node/v22.15.0/bin:${PATH}"

WORKDIR /app

# 先复制package.json并安装依赖
COPY package*.json ./
RUN npm install

# 再复制其余文件
COPY . .

# 生成Prisma客户端
RUN cd src/model && prisma generate && npx prisma generate && cd -

EXPOSE 3001

RUN npm run build:linux

# CMD ["./uav-receive-data-linux"]